<template>
  <div id="app">
    <div><img src="./assets/logo.png" /></div>
    <!-- <router-link to="/home" tag="button">首页</router-link>
    <router-link to="/about" tag="button">关于</router-link>
    <router-link to="/about" tag="button">关于</router-link> -->
    <router-link to="/home">首页</router-link>
    <router-link :to="{ path: '/about', query: { height: 188, name: 'abcd' } }">关于</router-link>
    <router-link :to="'/user/' + userId">用户</router-link>
    <router-view />
    <!-- 作用域插槽 -->
    <todo-list :todos="todoList">
       <template v-slot:default='slotProps'>
          <label>{{slotProps.itemValue.title}}</label>
          <input type='checkbox' v-model='slotProps.itemValue.isComplate' />
       </template>
    </todo-list>
  </div>
</template>

<script>
import TodoList from "./components/TodoList.vue";

export default {
  name: "App",
  components: { TodoList },
  data() {
    return {
      userId: "zhangsan",
      todoList: [
        {
          title: "大哥你好么",
          isComplate: true,
          id: 1,
        },
        {
          title: "小弟我还行",
          isComplate: false,
          id: 2,
        },
        {
          title: "你在干什么",
          isComplate: false,
          id: 3,
        },
        {
          title: "抽烟喝酒烫头",
          isComplate: true,
          id: 4,
        },
      ],
    };
  },
  methods: {},
};
</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  justify-items: center;
}

.router-link-active {
  color: red;
}

img {
  width: 100px;
  height: 100px;
}
</style>
